module.exports = {
  apps : [
    {
      name: "blog",
      autorestart: true,
      script: "build/bundle.js",
      env: {
        COMMON_VARIABLE: true
      },
      env_production: {
        NODE_ENV: "production"
      }
    }
  ],

  deploy : {
    production : {
      user : 'ming',
      host : '81.70.40.121',
      port: "49999",
      ref  : 'origin/master',
      repo : 'git@gitee.com:dyzq-mh_w/blog-system.git',
      path : '/www/blog/production',
      ssh_options: "StrictHostKeyChecking=no",
      "pre-deploy": "git fetch --all",
      "post-deploy": "npm install --registry=https://registry.npm.taobao.org && rm -rf dist build && npm run build && npm run prod:build && pm2 startOrReload ecosystem.config.js --env production",
      env: {
        NODE_ENV: "production"
      }
    }
  }
};
